package com.ns.scs.collections.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ns.scs.collections.dto.CollectionsPageDto;
import com.ns.scs.collections.entry.CollectionsEntry;
import com.ns.scs.collections.vo.CollectionsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 收藏数据层接口
 *
 * @author lw
 * @since 2024/09/23
 */
@Mapper
public interface CollectionsEntryMapper extends BaseMapper<CollectionsEntry> {

    /**
     * 分页查询
     *
     * @param dto  参数
     * @param page 分页参数
     * @return PropEntryVO
     */
    Page<CollectionsVO> getList(@Param("dto") CollectionsPageDto dto, @Param("page") Page page);

    /**
     * 根据资源id、用户id、类型查询
     *
     * @param resourceId 资源id
     * @param uid        用户id
     * @param type       类型
     * @return CollectionsVO
     */
    List<CollectionsVO> getByResourceIdAndUidAndType(Long resourceId, Long uid, String type);

    /**
     * 根据类型查询
     *
     * @param type 类型
     * @return CollectionsVO
     */
    List<CollectionsVO> getByType(String type);
}
